<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
      layout:decorate="~{layout/layout}">
<head>

</head>
<body>
<div layout:fragment="content">

    <h1>厂商批量修改</h1>
    <div>
        <form id="itemForm" class="form-horizontal" th:action="@{/supplier/update/}" method="post">
            <div class="form-group" th:each="supplier,stat : ${supplierList}">
                <input type="hidden" name="id" id="supplier.id" th:value="${supplier.id}"/>
                <label class="col-sm-1 control-label" th:text="${stat.count}">序号</label>

                <label class="col-sm-1 control-label" th:text="#{supplier.name}">厂商名</label>
                <div class="col-sm-5">
                    <input type="text" name="name" th:value="${supplier.name}" class="form-control"/>
                </div>
                <label class="col-sm-1 control-label" th:text="#{state}">状态</label>
                <div class="col-sm-2">
                    <input type="text" name="state" th:value="${supplier.state}" class="form-control" min="0"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-1">
                    <input type="submit" th:value="#{submit}" class="btn btn-info"/>
                </div>
                <div class="col-sm-1">
                    <a href="/supplier/list" th:href="@{/supplier/list}" class="btn btn-info" th:text="#{back}">返回</a>
                </div>
            </div>
        </form>
    </div>
</div>
<th:block layout:fragment="pagescript">
    <script th:src="@{/js/jquery-viladate/jquery.validate.min.js}"></script>
    <script th:src="@{/js/jquery-viladate/messages_zh.min.js}"></script>
    <script th:inline="javascript">
        $(document).ready(function () {
            $("#itemForm").validate({
                onsubmit: true,

                rules: {

                },
                messages: {

                },
                submitHandler: function (form) {
                    form.submit();
                },
                invalidHandler: function (form, validator) {
                    return false;
                }
            });
        });
    </script>

</th:block>
</body>
</html>
